<template>
	<view class="box" v-if="detail">
		<image class="img" :src="detail.headImg"></image>
		<view class="boxView">
			<view class="text1">{{detail.title}}</view>
			<view class="text2">
				<view>{{detail.author}}</view>
				<view>阅 3849</view>
			</view>
			<view class="text3">
				<rich-text :nodes="detail.content"></rich-text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getArticleDetail
	} from '../../api/article'
	export default {
		data() {
			return {
				detail: null,
			}
		},
		onLoad(options) {
			if (options.id) {
				getArticleDetail(options.id).then(({
					data
				}) => {
					this.detail = data;
				})
			}
		},
		methods: {
		}
	}
</script>
<style>
	page {
		background-color: #F5F7FA;
	}
</style>
<style lang="less" scoped>
	@import './index.less';
</style>